package com.lew.springboot.mybatis.demo.service.impl;


import com.lew.springboot.mybatis.demo.entity.User;
import com.lew.springboot.mybatis.demo.mapper.UserMapper;
import com.lew.springboot.mybatis.demo.service.UserService;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    @Transactional
    public void add(User user) {
        userMapper.insert(user);
    }

    @Override
    public List<User> getList() {
        return userMapper.getList();
    }

}
